<template>
    <div>
        这是index组件内容
        <h1>这是parent---{{$store.state.count}}</h1>
        <el-button @click="addCount">自增</el-button>

        <!-- 第一步 -->
        <child-1></child-1>
        <child-2></child-2>
        {{$store.state.list}}
        <el-button @click="setLsit">setList</el-button>
    </div>
</template>

<script>
//eslint --- 代码规范校验
import Child1 from './child1.vue'
import Child2 from './child2.vue'
export default {
    components:{
        Child1,
        Child2
    },
    data(){
        return {

        }
    },
    methods:{
        addCount(){
            this.$store.commit('addCount')
        },
        setList(){
            this.$store.commit('setList','这是从parent接收的值')
            //this.$emit('methodName',value)
        }
    }
}
</script>